import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/reset.css'
import {
  Container, Header, Aside, Main, Breadcrumb, BreadcrumbItem,
  Avatar, Dropdown, DropdownMenu, DropdownItem, Menu, Submenu,
  MenuItemGroup, MenuItem, Button, Row, Col, Input, DatePicker,
  Form, FormItem, Table, TableColumn, Switch, Pagination, Drawer,
  Select, Option, Upload, Message, Tooltip, Tag, InputNumber, MessageBox,
  Loading
} from 'element-ui'
import JsonExcel from 'vue-json-excel'
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import BaiduMap from 'vue-baidu-map'
Vue.use(VueQuillEditor /* { default global options } */)
Vue.prototype.$message = Message
Vue.prototype.$messageBox = MessageBox
Vue.use(BaiduMap, {
  ak: 'LxGiomkBklgnKFdckS425fMsEVa57iXP'
})
Vue.component('DownloadExcel', JsonExcel)
Vue.use(Container)
  .use(Header)
  .use(Aside)
  .use(Main)
  .use(Breadcrumb)
  .use(BreadcrumbItem)
  .use(Avatar)
  .use(Dropdown)
  .use(DropdownMenu)
  .use(DropdownItem)
  .use(Menu)
  .use(Submenu)
  .use(MenuItemGroup)
  .use(MenuItem)
  .use(Button)
  .use(Row)
  .use(Col)
  .use(Input)
  .use(DatePicker)
  .use(Form)
  .use(FormItem)
  .use(Table)
  .use(TableColumn)
  .use(Switch)
  .use(Pagination)
  .use(Drawer)
  .use(Select)
  .use(Option)
  .use(Upload)
  .use(Tooltip)
  .use(Tag)
  .use(InputNumber)
Vue.config.productionTip = false

new Vue({
  created () {
    // 当用户刷新时
    const role = localStorage.getItem('role') || ''
    this.$store.commit('permission/FILTER_MENUS', role)
  },
  router,
  store,
  render: h => h(App)
}).$mount('#app')
